package com.xqb.modules.service.impl;

import com.xqb.common.utils.DateUtils;
import com.xqb.modules.domain.po.InsBusinessLicense;
import com.xqb.modules.mapper.InsBusinessLicenseMapper;
import com.xqb.modules.service.IInsBusinessLicenseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 营业执照Service业务层处理
 * 
 * @author xqb
 * @date 2024-10-14
 */
@Service
public class InsBusinessLicenseServiceImpl implements IInsBusinessLicenseService 
{
    @Autowired
    private InsBusinessLicenseMapper insBusinessLicenseMapper;

    /**
     * 查询营业执照
     * 
     * @param id 营业执照主键
     * @return 营业执照
     */
    @Override
    public InsBusinessLicense selectInsBusinessLicenseById(Long id)
    {
        return insBusinessLicenseMapper.selectInsBusinessLicenseById(id);
    }

    /**
     * 查询营业执照列表
     * 
     * @param insBusinessLicense 营业执照
     * @return 营业执照
     */
    @Override
    public List<InsBusinessLicense> selectInsBusinessLicenseList(InsBusinessLicense insBusinessLicense)
    {
        return insBusinessLicenseMapper.selectInsBusinessLicenseList(insBusinessLicense);
    }

    /**
     * 新增营业执照
     * 
     * @param insBusinessLicense 营业执照
     * @return 结果
     */
    @Override
    public int insertInsBusinessLicense(InsBusinessLicense insBusinessLicense)
    {
        insBusinessLicense.setCreateTime(DateUtils.getNowDate());
        return insBusinessLicenseMapper.insertInsBusinessLicense(insBusinessLicense);
    }

    /**
     * 修改营业执照
     * 
     * @param insBusinessLicense 营业执照
     * @return 结果
     */
    @Override
    public int updateInsBusinessLicense(InsBusinessLicense insBusinessLicense)
    {
        insBusinessLicense.setUpdateTime(DateUtils.getNowDate());
        return insBusinessLicenseMapper.updateInsBusinessLicense(insBusinessLicense);
    }

    /**
     * 批量删除营业执照
     * 
     * @param ids 需要删除的营业执照主键
     * @return 结果
     */
    @Override
    public int deleteInsBusinessLicenseByIds(Long[] ids)
    {
        return insBusinessLicenseMapper.deleteInsBusinessLicenseByIds(ids);
    }

    /**
     * 删除营业执照信息
     * 
     * @param id 营业执照主键
     * @return 结果
     */
    @Override
    public int deleteInsBusinessLicenseById(Long id)
    {
        return insBusinessLicenseMapper.deleteInsBusinessLicenseById(id);
    }
}
